package exce1.exce01;

import java.util.Scanner;

//输入6个数  评委打分
public class demo7 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[6];
        for (int i = 0; i < 6; i++) {
            System.out.println("请输入第"+(i+1)+"个分数：");
            int num=sc.nextInt();
            if (num<=100&&num>=0){
                arr[i]=num;
            }else{
                System.out.println("输入有误，请重新输入：");
                i--;
            }
        }
        int sum=arr[0];
        int max=arr[0];
        int min=arr[0];
        for (int i = 1; i < arr.length; i++) {
            max=max>arr[i]?max:arr[i];
            min=min<arr[i]?min:arr[i];
            sum+=arr[i];
        }
        System.out.println((sum-max-min)/(arr.length-2));
    }
}
